
 #ifndef EDGE_H
 #define EDGE_H

 #include <QGraphicsItem>
#include "traffic_sim.h"
class Agent;
class Node;

 class Edge : public QGraphicsItem
 {
 public:
     Edge(Node *sourceNode, Node *destNode, Traffic_Sim::Traffic_Arc_Info & info_arc);
     ~Edge();

     Node *sourceNode() const;
     void setSourceNode(Node *node);
     Node *destNode() const;
     void setDestNode(Node *node);
     void adjust();
     void getSourcePoint();
     void addAgent(Agent *agent);
     enum { Type = UserType + 2 };
     int type() const { return Type; }

 protected:
     QRectF boundingRect() const;
     void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget);

 public:
     Node *source, *dest;
	int delay;

     QPointF sourcePoint;
     QPointF destPoint;
     Traffic_Sim::Traffic_Arc_Info  info_arc;

 };

 #endif
